home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / terminal / sysline-.1 / sysline- / sysline-1.1 / Configure < prev    next >
Encoding:
Text File  |  1996-03-16  |  1.7 KB  |  104 lines

  1. #!/bin/sh
  2.  
  3. # pathetic attempt at a configure utility -- bjd
  4. # for one thing it doesn't check if what you specify exists in those
  5. # places -- don't worry, you'll find out soon enough...  :^)
  6.  
  7. #set -x
  8.  
  9. rm -f Makefile config.h *.o
  10.  
  11.  
  12. CC=gcc
  13. echo
  14. echo
  15. echo "Compile sysline for aout or ELF? [ELF]"
  16. echo "1) ELF"
  17. echo "2) aout"        # aout-phaseout
  18. read choice
  19. echo
  20. case $choice in
  21.     2)    CC="gcc -bi486-linuxaout    # aout"
  22.         LDFLAGS="-L/usr/i486-linuxaout/lib " ;;
  23.     *)    CC="gcc    # ELF is assumed" ;;
  24. esac
  25. echo "...using ${CC}"
  26.  
  27.  
  28. ask_LIBPATH()
  29. {
  30.     #LDFLAGS="${LDFLAGS}"
  31.     echo -n "Path lib$1.a? [$2] "
  32.     read choice
  33.     echo
  34.     case $choice in
  35.         "")    ;;
  36.         *)    LDFLAGS="${LDFLAGS} -L$choice" ;;
  37.     esac
  38. }
  39.  
  40.  
  41. ask_INCPATH()
  42. {
  43.     CFLAGS=-I$2
  44.     echo -n "Path for $1 include files? [$2] "
  45.     read choice
  46.     echo
  47.     case $choice in
  48.         "")    ;;
  49.         *)    CFLAGS=-I$choice ;;
  50.     esac
  51. }
  52.  
  53.  
  54. echo
  55. echo "Compile sysline for the termcap or the terminfo database? [termcap]"
  56. echo "1) termcap"
  57. echo "2) terminfo (ncurses)"
  58. read choice
  59. case $choice in
  60.     2)    echo -e "...using terminfo (ncurses)\n"
  61.         TERMLIB=-lncurses
  62.         ask_LIBPATH "ncurses" "/usr/local/lib"
  63.         ask_INCPATH "ncurses" "/usr/include/ncurses"
  64.         ;;
  65.     *)    echo -e "...using termcap\n"
  66.         TERMLIB=-ltermcap
  67.         ;;
  68. esac
  69.  
  70.  
  71. # make config.h
  72. cp config.h.in config.h
  73. echo "...creating config.h"
  74. if [ ! "$TERMLIB" = "-ltermcap" ]
  75. then
  76.     cat <<- EOT >>config.h
  77.     /* terminfo */
  78.     #define TERMINFO
  79.     #include <term.h>
  80.     EOT
  81. fi
  82.  
  83. # make Makefile
  84. if [ "$TERMLIB" = "-ltermcap" ]
  85. then
  86.     cat <<- EOT >>config.h
  87.     /* curses */
  88.     /*#include <curses.h>*/
  89.     EOT
  90. else
  91.     cat <<- EOT >>config.h
  92.     /* ncurses */
  93.     #include <ncurses.h>
  94.     #include <unctrl.h>
  95.     EOT
  96. fi
  97.  
  98. echo -e "...creating Makefile\n"
  99. sed "s|@CC@|${CC}|
  100. s|@CFLAGS@|${CFLAGS}|
  101. s|@LDFLAGS@|${LDFLAGS}|
  102. s|@COMMENT@|${COMMENT}|
  103. s|@TERMLIB@|${TERMLIB}|" <Makefile.in >Makefile
  104.